<template>
  <div class="search">
    <headerNav
      :headerData="headerData"
      @handleRouter="handleRouter"
    ></headerNav>
    <div class="sarchChildren">
      <router-view></router-view>
    </div>
  </div>
</template>
<script>
import headerNav from '@/components/headerNav/headerNav.vue'
export default {
  data() {
    return {
      headerData: [
        {
          name: '单曲',
          path: '/index/search/song',
          SearchInfo: this.$route.query.name
        },
        {
          name: '歌手',
          path: '/index/search/singer',
          SearchInfo: this.$route.query.name
        },
        {
          name: '专辑',
          path: '/index/search/album',
          SearchInfo: this.$route.query.name
        },
        {
          name: '视频',
          path: '/index/search/video',
          SearchInfo: this.$route.query.name
        },
        {
          name: '歌单',
          path: '/index/search/musicList',
          SearchInfo: this.$route.query.name
        }
      ]
    }
  },
  methods: {
    handleRouter(path, SearchInfo) {
      this.$router.push({ path, query: { name: SearchInfo } })
      // console.log(path)
    }
  },
  components: {
    headerNav
  }
}
</script>
<style lang="scss" scoped>
.sarchChildren {
  padding: 20px;
}
</style>
